<%@ page import="bbs.mvc.Beans.Posting" %>
<%@ page import="bbs.mvc.Beans.DBUtils" %>
<%@ page import="java.sql.SQLException" %><%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2021/12/28
  Time: 16:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
//    String path = request.getContextPath();
//    String id = request.getParameter("id");
//    String sql;
//    sql ="SELECT * FROM `blogdata` WHERE" +
//            " `id` = " +"'"+ id +"'";
//    Posting posting= null;
//    try {
//        posting = DBUtils.getPosting(sql);
//    } catch (SQLException e) {
//        e.printStackTrace();
//    }
//    String title= posting.getTiltle();
//    String author= posting.getAuthor();
//    String content= posting.getContent();
%>
<html>
<head>
    <title>管理</title>
    <base target="_blank" />
    <meta charset="utf-8" />
    <meta name="model_url" content="http://s.163.com/special/00313OO9/sc2.html" />
    <link rel="stylesheet" type="text/css" media="all" href="http://img1.cache.netease.com/game/static/css/blizzard-games-common.css" />
    <link rel="stylesheet" type="text/css" media="all" href="http://img2.cache.netease.com/game/blizzard/sc2/css/sc2-common-2018.css?v2" />
    <link rel="stylesheet" type="text/css" media="all" href="admincss.css" />
    <script type="text/javascript" src="http://img1.cache.netease.com/game/static/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="http://img1.cache.netease.com/game/static/js/jquery.SuperSlide.2.1.1.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
    <svg class="icons-data" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 64 64">
        <g id="Icon_blizzard">
            <path d="M59,15.206"></path>
            <path d="M33.083,41.167c0.312,0.195,1.304,0.883,1.519,1.036   c0.056,0.328,0.077,0.686,0.149,1.025c-0.348-0.133-5.094-0.064-5.482,0.036c-0.287,0.113-0.487,0.512-0.702,0.512   c-0.312,0-0.512-0.369-0.63-0.482c0.41-0.512,0.722-1.081,1.332-1.373c0.135-0.919,0.197-1.848,0.184-2.776l-0.01-20.988   c0.004-0.236-0.022-0.472-0.077-0.702c-0.184-0.512-1.826-1.148-1.998-1.296c0.1-0.194,0.223-0.375,0.369-0.538   c1.735,0.209,4.49,0.209,6.225,0c0.371,0.221,0.564,0.652,0.482,1.076c-0.558,0.179-1.537,0.692-1.48,1.445L33.083,41.167z"></path>
            <path d="M37.925,23.879l-0.737-0.192l-0.415-4.772l0.236-3.33l8.415,0.117l0.145,7.736   L38.833,40.5l7.447-5.003l-0.613,7.669l-9.75-0.25l2.25-11.5l5.167-13.75c0,0-0.542-0.083-2.833,0   C38.208,17.75,37.925,23.879,37.925,23.879z"></path>
            <polygon points="48.375,22.5 46.688,23.625 46.799,19.398 46.75,15.585 56.431,15.585    54,23.744 49,43.583 57.53,40.417 57.5,46.917 46.833,46.88 47.667,33.713 52.833,17.969 50.066,17.969  "></polygon>
            <path d="M20.438,15.313l0.125,1.063c0,0,2.938,1.563,1.563,2.688   c-0.063,2.125,0,26.688,0,26.688L19.5,48.563l4.625-1.125l18.5,1.5l-0.827-4.793l-15.986,0.963c0,0,0-24.42,0-26.482   S20.438,15.313,20.438,15.313z"></path>
            <path d="M19.188,31.188c0-4-2.596-4.783-2.596-4.783s2.659-3.029,2.659-6.779   s-3.875-3.75-3.875-3.75H6.75l-0.125,0.688L8,18.313v29.25l-1.183,0.706L7.37,48.78l2.692,0.095   C21.5,48.875,19.188,35.188,19.188,31.188z M15.188,40.813c-0.438,4-3.545,4.459-3.545,4.459l1.014-1.834V28.556   C15.377,29.55,15.625,36.813,15.188,40.813z M12.438,25.108V19c0,0,2.938-0.375,2.938,2.875S12.438,25.108,12.438,25.108z"></path>
        </g>
    </svg>
    <link rel="stylesheet" href="//static.ws.126.net/game/img13/common/assets/css/normalize.css"/>
    <link href="//static.ws.126.net/game/img16/index0031/css/global0031_o_4.css" rel="stylesheet" />
<%--    <script src="//static.ws.126.net/cnews/js/ntes_jslib_1.x.js" type="text/javascript"></script>--%>
    <script lang="javascript">

        function showBooks(page) {
            jQuery.ajax({
                url: "../posti?page=" + page,
                method: "GET",
                dataType: "json"
            }).done(function(result){
                updatePostTable(result.posts);
            }).fail(function(xhr, status){
                console.log(status);
            });
        }

        function updatePostTable(posts) {
            var t = jQuery("#postTable");
            t.empty();
            for (var i=0; i<posts.length; i++) {
                var b = posts[i];
                var tr =jQuery("<li>");
                tr.append(
                    "<a href="
                    + "\"./post.jsp?id=" +
                    b.id +
                    "\"><span className=\"article-date\" style='float: right;color: rgba(255,255,255,0.5);'>"
                    + b.author
                    + "</span>"
                    + b.title
                    + "</a>&nbsp;&nbsp;&nbsp;&nbsp;"
                    // + "<div style='display: inline-block;width: 40px;height: 10px;'></div>"
                    + "<a style='height: 40px;width: 45px;' href='../admin/edit.jsp?id="
                    + b.id
                    + "'><button class='login-button' style='height: 100%;width: 100%;'>修改</button></a>&nbsp;&nbsp;"
                    // + "<div style='display: inline-block;width: 40px;height: 10px;'></div>"
                    // + "<button style='height: 40px;width: 45px;' placeholder='删除'><a href='./delete-servlet?id="
                    // + b.id
                    // + "</a>'</button>"
                    + "<a style='height: 40px;width: 45px;' href='../delete-servlet?id="
                    + b.id
                    + "'><button  class='login-button' style='height: 100%;width: 100%;'>删除</button></a>&nbsp;&nbsp;"
                    + "</li>"
                );
                t.append(tr);
            }}
    </script>
    <style>
        .login-button { /* 按钮美化 */
            border-width: 0px; /* 边框宽度 */
            border-radius: 3px; /* 边框半径 */
            background: #52bdfe; /* 背景颜色 */
            cursor: pointer; /* 鼠标移入按钮范围时出现手势 */
            outline: none; /* 不显示轮廓线 */
            font-family: Microsoft YaHei; /* 设置字体 */
            color: white; /* 字体颜色 */
            font-size: 17px; /* 字体大小 */
        }
    </style>

</head>
<body onload="showBooks(1)">
<div class="body">
    <div class="content-container clear">
        <div class="sidebar-esport-event">

        </div>
        <!-- Blizzard News -->
        <div class="sidebar-news">
            <div class="sidebar-container">
                <div class="sidebar-title">
                    <div class="game-icon">
                    </div>
                    <h2>所有设定</h2>
                </div>
                <div class="sidebar-content">
                    <ul class="sidebar-news-list" id="postTable">
                    </ul>
                </div>
            </div>
        </div>


    </div>
</div>

<style type="text/css">
    .N-nav-bottom-main-l{width:188px;}
    .content-subfoot-bg{
        background: #03274f;
        padding: 30px 0px;
        margin-top: 30px;
    }
    .content-subfoot{
        width: 1200px;
        color: #fff;
        margin: 20px auto;
        font-size: 14px;
    }
    .content-subfoot a{
        color: #fff;
    }
    .content-subfoot a:hover{
        color:#0af;
    }
    .mod_hezuo h3{
        padding-bottom: 15px;
    }
    .mod_hezuo h3 span{
        font-size: 20px;
        border-top: 3px #1dafec solid;
        padding-top: 5px;
    }
    .content-subfoot .mod_info{
        text-align: right;
        margin-top: 20px;
    }
</style>
<style>
    .N-nav-bottom-sub{width: 960px; margin:0 auto; position: relative; height: 0px; z-index: 1000; }
    .ne_foot_feedback_box{width: 360px; height: 270px; position: absolute; z-index: 9999; bottom: 34px; right: 0; display: none; }
    .ne_foot_feedback_box .feedback_close{width: 11px; height: 11px; background: url(http://img1.cache.netease.com/f2e/www/feedback/images/box_close.png) no-repeat; position: absolute; right: 8px; top: 7px; font-size: 0; overflow: hidden; text-indent: -9990em; }
    .ne_foot_feedback_box .feedback_cor{width: 19px; height: 13px; background: url(http://img1.cache.netease.com/f2e/www/feedback/images/box_cor.png) no-repeat; position: absolute; left: 236px; top: 250px; }
    .ne_foot_feedback_box .feedback_box{border:1px solid #cdcdcd; background: #fff; width: 358px; height: 250px; overflow: hidden; }
    .ne_foot_feedback_box .feedback_box iframe{display: block; border: 0; width: 100%; height: 250px; overflow: hidden; }
</style>
<div class="N-nav-bottom-sub" id="N-nav-bottom-sub"></div>
</body>
</html>
